<template>
  <a-table :columns="tableColumns" :pagination="false" :data-source="dataSource" :scroll="{ x: 900, y: tableHeight - 80 }">
    <!-- 状态 -->
    <template slot="status" slot-scope="status, record">
      <span v-if="status !== 3">{{ record.statusDesc }}</span>
      <span v-else style="color:red">{{ record.statusDesc }}</span>
    </template>
    <!-- 合作状态 -->
    <!-- 1审核中;2已通过;3审核失败;4已到期 0未提交-->
    <!-- <template slot="cooperateStatus" slot-scope="text, record">
      <span :class="[record.cooperateStatus === 3 ? 'color-f55' : null]">
        {{ record.cooperateStatusDesc || '--' }}
        <a-tooltip v-if="record.cooperateStatus === 3">
          <template slot="title">
            {{ record.refusedReason }}
          </template>
          <a-icon type="info-circle" class="color-f55" />
        </a-tooltip>
      </span>
    </template> -->
    <!-- 操作 -->
    <template slot="action" slot-scope="text, record">
      <slot name="action" :row="record"></slot>
    </template>
  </a-table>
</template>
<script>
export default {
  name: 'accountTable',
  props: {
    dataSource: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      tableColumns: [
        { title: 'ID', width: 100, dataIndex: 'id' },
        { title: '申请时间', width: 200, dataIndex: 'applyTime' },
        { title: '姓名', width: 150, dataIndex: 'name' },
        { title: '手机号', width: 150, dataIndex: 'phoneNumber' },
        {
          title: '身份证号',
          width: 200,
          dataIndex: 'idCard',
          customRender: (text) => {
            return text || '无'
          }
        },
        { title: '在播平台', width: 150, dataIndex: 'platform' },
        { title: '类型', width: 150, dataIndex: 'applyTypeDesc' },
        { title: '账号申请状态', width: 120, dataIndex: 'status', scopedSlots: { customRender: 'status' } },
        // { title: '合作状态', width: 120, dataIndex: 'cooperateStatus', scopedSlots: { customRender: 'cooperateStatus' } },
        { title: '操作', fixed: 'right', width: 130, dataIndex: 'action', scopedSlots: { customRender: 'action' } }
      ]
    }
  }
}
</script>
<style scoped lang="scss"></style>
